.class public Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;
.super Lcom/burstly/lib/component/networkcomponent/FocusAwareLayout;
.source "ClickAwareWrapper.java"


# static fields
.field static final LOG:Lcom/burstly/lib/util/LoggerExt; = null

.field static final WAIT_BETWEEN_CLICKS:I = 0x7d0


# instance fields
.field private final mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

.field private mIsInterstitial:Z

.field volatile mIsTouchDisabled:Z

.field private final mNetworkName:Ljava/lang/String;

.field final mViewId:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 36
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->LOG:Lcom/burstly/lib/util/LoggerExt;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Lcom/burstly/lib/component/IBurstlyAdaptorListener;Ljava/lang/String;Ljava/lang/String;)V
    .locals 0
    .parameter "context"
    .parameter "listener"
    .parameter "viewId"
    .parameter "networkName"

    .prologue
    .line 78
    invoke-direct {p0, p1}, Lcom/burstly/lib/component/networkcomponent/FocusAwareLayout;-><init>(Landroid/content/Context;)V

    .line 79
    iput-object p2, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    .line 80
    iput-object p3, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mViewId:Ljava/lang/String;

    .line 81
    iput-object p4, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mNetworkName:Ljava/lang/String;

    .line 82
    return-void
.end method

.method private enableAfterDelay()V
    .locals 2

    .prologue
    .line 138
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper$1;

    invoke-direct {v1, p0}, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper$1;-><init>(Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 154
    .local v0, thread:Ljava/lang/Thread;
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 155
    return-void
.end method

.method private static logEvent(Landroid/view/MotionEvent;)V
    .locals 5
    .parameter "ev"

    .prologue
    const/4 v4, 0x0

    .line 90
    const-string v0, "EVENT TYPE"

    .line 91
    .local v0, eventType:Ljava/lang/String;
    invoke-virtual {p0}, Landroid/view/MotionEvent;->getAction()I

    move-result v1

    packed-switch v1, :pswitch_data_0

    .line 106
    :goto_0
    :pswitch_0
    return-void

    .line 93
    :pswitch_1
    sget-object v1, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "EVENT TYPE"

    const-string v3, "DOWN"

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 96
    :pswitch_2
    sget-object v1, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "EVENT TYPE"

    const-string v3, "UP"

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 99
    :pswitch_3
    sget-object v1, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "EVENT TYPE"

    const-string v3, "CANCEL"

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 102
    :pswitch_4
    sget-object v1, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "EVENT TYPE"

    const-string v3, "OUTSIDE"

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    goto :goto_0

    .line 91
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_1
        :pswitch_2
        :pswitch_0
        :pswitch_3
        :pswitch_4
    .end packed-switch
.end method


# virtual methods
.method public dispatchKeyEvent(Landroid/view/KeyEvent;)Z
    .locals 7
    .parameter "event"

    .prologue
    const/4 v6, 0x1

    .line 168
    invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I

    move-result v0

    if-ne v6, v0, :cond_0

    invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I

    move-result v0

    const/16 v1, 0x17

    if-ne v0, v1, :cond_0

    .line 169
    iget-boolean v0, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mIsTouchDisabled:Z

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    if-eqz v0, :cond_0

    .line 170
    sget-object v0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mViewId:Ljava/lang/String;

    const-string v2, "onClick {0}."

    new-array v3, v6, [Ljava/lang/Object;

    const/4 v4, 0x0

    iget-object v5, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mNetworkName:Ljava/lang/String;

    aput-object v5, v3, v4

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logDebug(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 171
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mNetworkName:Ljava/lang/String;

    iget-boolean v2, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mIsInterstitial:Z

    invoke-interface {v0, v1, v2}, Lcom/burstly/lib/component/IBurstlyAdaptorListener;->adWasClicked(Ljava/lang/String;Z)V

    .line 172
    iput-boolean v6, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mIsTouchDisabled:Z

    .line 173
    invoke-direct {p0}, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->enableAfterDelay()V

    .line 176
    :cond_0
    invoke-super {p0, p1}, Lcom/burstly/lib/component/networkcomponent/FocusAwareLayout;->dispatchKeyEvent(Landroid/view/KeyEvent;)Z

    move-result v0

    return v0
.end method

.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
    .locals 4
    .parameter "ev"

    .prologue
    const/4 v3, 0x1

    .line 111
    invoke-static {p1}, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->logEvent(Landroid/view/MotionEvent;)V

    .line 112
    iget-boolean v0, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mIsTouchDisabled:Z

    if-nez v0, :cond_0

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getAction()I

    move-result v0

    if-ne v0, v3, :cond_0

    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    if-eqz v0, :cond_0

    .line 113
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mAdaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mNetworkName:Ljava/lang/String;

    iget-boolean v2, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mIsInterstitial:Z

    invoke-interface {v0, v1, v2}, Lcom/burstly/lib/component/IBurstlyAdaptorListener;->adWasClicked(Ljava/lang/String;Z)V

    .line 114
    iput-boolean v3, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mIsTouchDisabled:Z

    .line 115
    invoke-direct {p0}, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->enableAfterDelay()V

    .line 117
    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public setInterstitial(Z)V
    .locals 0
    .parameter "isInterstitial"

    .prologue
    .line 163
    iput-boolean p1, p0, Lcom/burstly/lib/component/networkcomponent/ClickAwareWrapper;->mIsInterstitial:Z

    .line 164
    return-void
.end method
